<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div>
    <span>state.count is </span>
    <span id="count">0</span>
  </div>
  <script src="./lib/vue.js"></script>
  <script>
    const vm = new Vue()
    const watch = vm.$watch.bind(vm)
    const observable = Vue.observable

    const state = observable({ count: 0 })

    watch(
      function () {
        document.getElementById('count').innerText = state.count
      }
    )

    window.setInterval(() => {
      state.count += 1
    }, 1000)
  </script>
</body>
</html>